import { post,get } from '@/api/request'
export const courseApi ={
    addUrl(url){
        return '/eascourse/course'+url
    },
    listCourse(data){
        return post(this.addUrl('/list'),data)
    },
    listCourseNopage(data){
        return post(this.addUrl('/listnopage'),data)
    },
    courseInfo(id){
        return get(this.addUrl('/info/'+id))
    },
    saveCourse(data){
        return post(this.addUrl('/save'),data)
    },
    updateCourse(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveCourse(data)
        }else if(status =='update'){
            return this.updateCourse(data)
        }
    },
    deleteCourse(data){
        return post(this.addUrl('/delete'),data)
    },


}
/**
 * 课表接口
 */
export const curriculumApi ={
    addUrl(url){
        return '/eascourse/curriculum'+url
    },
    //获取用户课表
    getusercurriculum(data){
        return post(this.addUrl('/getusercurriculum'),data)
    },
    getcurriculum(data){
        return post(this.addUrl('/getcurriculum'),data)
    },
    courseInfo(id){
        return get(this.addUrl('/info/'+id))
    },
    saveCourse(data){
        return post(this.addUrl('/save'),data)
    },
    updateCourse(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveCourse(data)
        }else if(status =='update'){
            return this.updateCourse(data)
        }
    },
    deleteCourse(data){
        return post(this.addUrl('/delete'),data)
    },
    // 获取我的课程
    getmycourse(){
        return post(this.addUrl('/getmycourse'))
    },
    //获取所有课表课程
    getallcourse(data){
        return post(this.addUrl('/getallcourse'),data)
    },
    //获取所有课程所有学生
    getCourseStudent(data){
        return post(this.addUrl('/getstudent'),data)
    },
    clear(data){
        return post(this.addUrl('/clear'),data)
    }

}
/**
 * 成绩接口
 */
export const scoresApi={
    addUrl(url){
        return '/eascourse/scores'+url
    },
    listScores(data){
        return post(this.addUrl('/list'),data)
    },
    scoresInfo(data){
        return post(this.addUrl('/info'),data)
    },
    saveScores(data){
        return post(this.addUrl('/save'),data)
    },
    updateScores(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveScores(data)
        }else if(status =='update'){
            return this.updateScores(data)
        }
    },
    deleteScores(data){
        return post(this.addUrl('/delete'),data)
    },
    getMyScores(data){
        return post(this.addUrl('/getmyscores'),data)
    }

}
/**
 * 考试安排接口
 */
export const examinationarrangementApi={
    addUrl(url){
        return '/eascourse/examinationarrangement'+url
    },
    list(data){
        return post(this.addUrl('/list'),data)
    },
    Info(id){
        return get(this.addUrl('/info/'+id))
    },
    save(data){
        return post(this.addUrl('/save'),data)
    },
    update(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.save(data)
        }else if(status =='update'){
            return this.update(data)
        }
    },
    delete(data){
        return post(this.addUrl('/delete'),data)
    },
    arrangment(data){
        return post(this.addUrl('/arrangment'),data)
    },
    getmyexam(data){
        return post(this.addUrl('/getmyexam'),data)
    }

}